﻿using AutoMapper;
using DTcms.Core.Model.Models;
using DTcms.Core.Model.ViewModels;

namespace DTcms.Core.Model.Profiles
{
    public class PaymentProfile : Profile
    {
        /// <summary>
        /// 支付方式实体映射
        /// </summary>
        public PaymentProfile()
        {
            //支付方式，将源数据映射到DTO
            CreateMap<Payments, PaymentsDto>();
            CreateMap<Payments, PaymentsEditDto>();
            //支付方式，将DTO映射到源数据
            CreateMap<PaymentsEditDto, Payments>();

            //支付收款，将源数据映射到DTO
            CreateMap<PaymentCollection, PaymentCollectionDto>();
            //支付收款，将DTO映射到源数据
            CreateMap<PaymentCollectionEditDto, PaymentCollection>();

            //站点支付方式，将源数据映射到DTO
            CreateMap<SitePayment, SitePaymentDto>();
            CreateMap<SitePayment, SitePaymentEditDto>();
            //站点支付方式，将DTO映射到源数据
            CreateMap<SitePaymentEditDto, SitePayment>();
        }
    }
}
